The nucleon-nucleon potential in the nonrelativistic quark model