Accurate correlation potentials from integral formulation of density functional perturbation theory