Variational Rayleigh iteration