We give a novel definition of gravitational energy for an arbitrary theory of gravity including quadratic-curvature corrections to Einstein's equations. We focus on the theory in four dimensions, in the presence of a negative cosmological constant, and with asymptotically anti-de Sitter (AdS) boundary conditions. As a first example, we compute the gravitational energy and angular momentum of Schwarzschild-AdS black holes, for which we obtain results consistent with previous computations performed using different methods. However, our method is qualitatively different due to the fact that it is intrinsically nonlinear. It relies on the idea of adding to the gravity action topological invariant terms which suffice to regularize the Noether charges and render the variational problem well-posed. This is an idea that has been previously considered in the case of second-order theories, such as general relativity and which, as shown here, extends to higher-derivative theories. Besides black holes, we consider other solutions such as gravitational waves in AdS, for which we also find results that are in agreement. This enables us to investigate the consistency of this approach in the non-Einstein sector of the theory.