Resonant dispersion of the nonlinear atomic scattering factor