Optimal control of seawater intrusion in coastal aquifers