A conservative Fourier pseudospectral method for the nonlinear Schrödinger equation