Charmonium states in strong magnetic fields