The singular set of the minima of certain quadratic functionals