In the Hamiltonian formulation of General Relativity the energy associated to an asymptotically flat space-time with metric $g_{\mu\nu}$ is related to the Hamiltonian $H_{GR}$ by $E=H_{GR}[g_{\mu\nu}]-H_{\rm GR}[\eta_{\mu\nu}]$, where the subtraction of the flat-space contribution is necessary to get rid of an otherwise divergent boundary term. This classic result indicates that the energy associated to flat space does not gravitate. We apply the same principle to study the effect of zero-point fluctuations of quantum fields in cosmology, proposing that their contribution to the cosmic expansion is obtained computing the vacuum energy of quantum fields in a FRW space-time with Hubble parameter $H(t)$ and subtracting from it the flat-space contribution. [...] After renormalization, this produces a renormalized vacuum energy density $\sim M^2H^2(t)$, where $M$ is the scale where quantum gravity sets is, so for $M$ of order of the Planck mass a vacuum energy density of the order of the critical density can be obtained without any fine tuning. The counterterms can be chosen so that the renormalized energy density and pressure satisfy $p=w\rho$, with $w$ a parameter that can be fixed by comparison to the observed value, so in particular one can chose $w=-1$. An energy density evolving in time as $H^2(t)$ is however observationally excluded as an explanation for the dominant dark energy component which is responsible for the observed acceleration of the universe. We rather propose that zero-point vacuum fluctuations provide a new subdominant "dark" contribution to the cosmic expansion that, for a UV scale $M$ slightly smaller than the Planck mass, is consistent with existing limits and potentially detectable.