Iterative derivation of effective potentials to sample the conformational space of proteins at atomistic scale