Using the quasiparticle (QP) self-consistent $\mathit{GW}$ (QS$\mathit{GW}$) and local-density approximations, we calculate the $q$-dependent static dielectric function of undoped graphene and derive an effective two-dimensional (2D) dielectric function corresponding to screening of point charges. In the $q$$\ensuremath{\rightarrow}$0 limit, the 2D dielectric constant is found to scale approximately as the square root of the macroscopic dielectric function. Its value is $\ensuremath{\simeq}4$, in agreement with the predictions of the Dirac model. At the same time, in contrast with the Dirac model, the dielectric function is strongly dependent on $q$. The QS$\mathit{GW}$ approximation is shown to describe QP levels very well, with small systematic errors analogous to bulk $\mathit{sp}$ semiconductors. Local-field effects are rather more important in graphene than in bulk semiconductors.