We add an effective atom-centered nonlocal term to the exchange-correlation potential in order to cure the lack of London dispersion forces in standard density functional theory. Calibration of this long-range correction is performed using density functional perturbation theory and an arbitrary reference. Without any prior assignment of types and structures of molecular fragments, our corrected generalized gradient approximation density functional theory calculations yield correct equilibrium geometries and dissociation energies of argon-argon, benzene-benzene, graphite-graphite, and argon-benzene complexes.