Total energies from variational functionals of the Green function and the renormalized four-point vertex