Two-photon Hanle effect in Ramsey interrogation