Charge and spin states of helium atoms approaching metal surfaces