Scattering in the energy space for the NLS with variable coefficients