Interactions of macromolecules with salt ions: An electrostatic theory for the Hofmeister effect