Decisions like this are made as part of a process going on for months (the better part of a year, with a planning, strategic and financial impact on the rest of their programming and their other projects in development), not weeks, let alone overnight. The resounding success of season 3 in terms of subscriptions, home-market sales that keeps going great and bring them new viewers, commitments by foreign buyers etc. are largely responsible for that. At most the record breaking ratings for s4e1 might have decided them to make public the fact they've actually negotiated for 2 more seasons already instead of announcing it as
"renewed for a season, with 2 years for the creators", but even that I'd suspect was planned in advance (they know how many people subscribed in time for the start of s4, they can anticipate those "good ratings" to an extent.).
They're merely taking advantage of the maximum visibility the show gets in the media worldwide right now to make that announcement. They were aiming to get what they got: record breaking audience for GOT s4x1, two more seasons already confirmed, what are you waiting for if you're not watching this already? The hype among TV reviewers makes it even more easy for them to use that vehicle for marketing.
It had been announced weeks ago that the show creators' contract with HBO had been renewed for 2 years, now we simply learn it was part of a global renewal of the series for 2 more seasons.