The first thing I will look for is dirt in the MagSafe port, there might be something there, but the chances are small.
The second thing I will do is a reset on SMC and PRAM, and any of the hardware stuff. I am not sure if PRAM is related, but hey, we want to rule out any possibility.
You can find how to reset PRAM here, SMC here. (SMC is a more likely problem, do that first)
The third thing I would do is a clean install, but no need to tell you, backup first. Whether a data backup or a Time Machine backup, but data backup will be cleaner.
Here comes the last thing we could do, open it up. Nay, just kidding, send it to Apple, have them figure it out. If it's not out of warranty for long, you could get a free repair, it's about chances.