Knee pain would be related to force being applied through your joints (more so than the muscles) when they are not in a properly aligned state.
Your fore aft positioning shouldnt be making such a big difference. You should try to adjust the nose tilt (up or down) and overall saddle height as well.