Averaging inhomogeneities in scalar-tensor cosmology