Contact potential that recognizes the correct folding of globular proteins