Inelastic effects in the scattering of 4He by a graphite surface