We calculate, for nonzero momentum transfer, the dipole formula for the high energy behaviour of elastic and quasielastic scattering of a virtual photon. We obtain an expression of the nonforward photon impact factor and of the nonforward photon wave function, and we give a physical interpretation.