Optimal contract design for outsourcing: pricing and quality decisions