The present acceleration of the Universe strongly indicated by recent observational data can be modeled in the scope of a scalar-tensor theory of gravity. We show that it is possible to determine the structure of this theory (the scalar field potential and the functional form of the scalar-gravity coupling) along with the present density of dustlike matter from the following two observable cosmological functions: the luminosity distance and the linear density perturbation in the dustlike matter component as functions of redshift. Explicit results are presented in the first order in the small inverse Brans-Dicke parameter 1/omega.