Determination of the charge distribution of methane by a method of density constraints