A method for optimizing potential-energy functions by a hierarchical design of the potential-energy landscape: Application to the UNRES force field