First, what is your age ?? I think you need to do enough warm up and stretch before you start riding. Also, the saddle height is related to your riding pose, which affect you knee pain as well. Adjusting the saddle back and forward, up and down little bit. You will find the big difference.
Hope this helps!