  The addition of boundary counterterms to the gravitational action of
asymptotically anti-de Sitter spacetimes permits us to define the partition
function unambiguously without background subtraction. We show that the
inclusion of p-form fields in the gravitational action requires the addition of
further counterterms which we explicitly identify. We also relate logarithmic
divergences in the action dependent on the matter fields to anomalies in the
dual conformal field theories. In particular we find that the anomaly predicted
for the correlator of the stress energy tensor and two vector currents in four
dimensions agrees with that of the ${\cal{N}} = 4$ superconformal SU(N) gauge
theory.
