The Optimal Licensing Contract in a Differentiated Stackelberg Model