Charmonium potentials: matching perturbative and lattice QCD