Variational Gaussian approximation for the magnetic Schrödinger equation