Effective spectral function for quasielastic scattering on nuclei