Optimal Control of Partial Differential Equations with Nonsmooth Cost Functionals