Respective roles of short-and long-range interactions in protein folding