I have overdeveloped quads, which has affected my knees, what are some exercises that will help counteract this imbalance?
First, you should really consult with a sports medicine doctor. That's the only way to truly diagnose and evaluate the best way to correct the specific problem that you're having.
That said, this problem is usually a result of a combination of over developed quads, as you suspect, and also a lack of flexibility in your hamstrings. Any hamstring stretch will most likely help, over time.
Try seated and standing toe touches, downward facing dog, and those seated one legged stretches where you reach for one foot while the other is folded in. You'll find plenty of other stretches if you do a search for "hamstring stretches."
Most importantly, don't push it. Gaining flexibility takes time more than effort. Pushing is actually counter productive. Just do the stretches gently and trust in time to do the real work for you.
Like the other two state, consulting a specialist first is a good idea. If there truly is something wrong (not just minor inflamation) you'll save yourself a lot of time and headache by getting an early diagnosis.
That said, tTreatment largely depends on the factors that have caused the pain. Are you a power lifter or someone who runs 80 miles a week? Do you lift heavy things at work all day? Are you arthritic? The first step is to identity the activity\ailment that has caused the pain and either stop the acdtivity completely or cut back drastically.
After that, begin strengthening and stretching the hamstrings and quadriceps by way of low weight high rep exercises.
Here's a link to some hamstring exercieses that I swear by: