Levinson's theorem for energy-dependent potentials