We derive an expression for the phase shift of an atom interferometer in a gravitational field taking into account both the finite duration of the light pulses and the effect of a small perturbing potential added to a stronger uniform gravitational field, extending the well-known results for rectangular pulses and at most quadratic potentials. These refinements are necessary for a correct analysis of present day high resolution interferometers.