We demonstrate that a quantitative analysis of the contrast obtained in electrostatic force microscopy images that probe the dielectric response of the sample (scanning polarization force microscopy (SPFM)) requires numerical simulations that take into account both the macroscopic shape of the tip and the nanoscopic tip apex. To simulate the SPFM contrast, we have used the generalized image charge method (GICM), which is able to accurately deal with distances between a few nanometers and several microns, thus involving more than three orders of magnitude. Our numerical simulations show that the macroscopic shape of the tip accounts for most of the SPFM contrast. Moreover, we find a quasi-linear relation between the working tip-sample distance and the contrast for tip radii between 50 and 200nm. Our calculations are compared with experimental measurements of the contrast between a thermally grown silicon oxide sample and a few-layer graphene film transferred onto it. © 2009 IOP Publishing Ltd.