  On four-dimensional closed manifolds we introduce a class of canonical
Riemannian metrics, that we call weak harmonic Weyl metrics, defined as
critical points in the conformal class of a quadratic functional involving the
norm of the divergence of the Weyl tensor. This class includes Einstein and,
more in general, harmonic Weyl manifolds. We prove that every closed
four-manifold admits a weak harmonic Weyl metric, which is the unique (up to
dilations) minimizer of the functional in a suitable conformal class. In
general the problem is degenerate elliptic due to possible vanishing of the
Weyl tensor. In order to overcome this issue, we minimize the functional in the
conformal class determined by a reference metric, constructed by Aubin, with
nowhere vanishing Weyl tensor. Moreover, we show that anti-self-dual metrics
with positive Yamabe invariant can be characterized by pinching conditions
involving suitable quadratic Riemannian functionals.
