Thermodynamics of polyelectrolyte solutions in an electric field