The L_2-norm of the Weyl curvature (i.e. Weyl energy) of Riemannian metrics on compact orientable 4-manifolds is particularly useful in conformal geometry and has a close relationship with Calabi action and extremal Kahler metrics on compact complex surfaces. I will talk about two cases where this energy functional is used: First, inspired by the work of C. LeBrun, I will introduce the Bach-Merkulov equations, which can be thought of as the conformally invariant generalizations of the classical Einstein-Maxwell equations in general relativity. It turns out that solutions of Bach-Merkulov equations are critical points of Weyl energy restricted to some appropriate class of metrics. Extremal Kahler metrics are among these solutions. As another application I will show how this functional can be used to detect Einstein (or Poincare-Einstein) metrics on some compact complex surfaces.