In this work, we investigate cosmologies where the gravitational constant varies in time, with the aim of explaining the accelerated expansion without a cosmological constant. We achieve this by considering a phenomenological extension to general relativity, modifying Einsteins field equations such that $G$ is a function of time, $G(t)$, and we preserve the geometrical consistency (Bianchi identity) together with the usual conservation of energy by introducing a new tensor field to the equations. In order to have concrete expressions to compare with cosmological data, we posit additional properties to this tensor field, in a way that it can be interpreted as a response of spacetime to a variation of $G$. Namely, we require that the energy this tensor represents is nonzero only when there is a time variation of $G$, and its energy depends on the scale factor only because of its coupling to $G$ and the matter and radiation energy densities. Focusing on the accelerated expansion period, we use type Ia supernovae and baryon acoustic oscillation data to determine the best fit of the cosmological parameters as well as the required variation in the gravitational constant. As a result, we find that it is possible to explain the accelerated expansion of the Universe with a variation of $G$ and no cosmological constant. The obtained variation of $G$ stays under 10 % of its current value in the investigated redshift range and it is consistent with the local observations of $dot{G}/G$.