So what I'm about to post is all speculation, but I wonder if Oviedo's injury had anything to do with this. The timing may be a coincidence, but it could be that seeing Oviedo go down with a long term injury, Baines realized he still has work to do here, there are more challenges for him at Everton that he needs to overcome.
I think that watching Oviedo's reaction to the injury has affected the team profoundly, the fact that he was stretchered off the pitch telling the other players to go on and win it. Recently I've been seeing a lot of posts about how Martinez's approach makes it feel like the club is more of a family, something that's been said for ever but not always appeared so in practice.
Baines is undoubtedly a very important player, but his importance increased ten-fold when Oviedo went down. I think it's possible Baines may have planned to re-sign a contract in the summer (it would most likely be more lucrative for him), but when this happened he decided to speed things along for the good of the team.
Leighton, you're no longer just a world class left back, whatever happens from here on out you will always be remembered as an Everton legend.
edit: it's also possible that this has been in the works for a long time (as has been claimed), but Martinez decided to release it now as a lift before the derby. Hope it has the desired effect. COYB!