Before seeking a repair, you might want to do some troubleshooting of your own. Sometimes a runaway process can cause an iPhone to overheat. Chris Breen provides some tips in Troubleshooting a battery-sucking iPhone 4S. I solved a problem I had with my own overheating iPhone 4 by wiping the phone and reinstalling the OS. I did a fresh install, I didn't restore the phone from a backup. (This was when iOS 5 was first release, many of these problems have been sorted out now by OS updates.)
If you can't solve the problem yourself the next step is to take the phone to an authorized Apple repair center, in general an Apple Store. Which brings the warranty into play:
From Apple's (US) warranty for the iPhone 4
This warranty does not apply: (a) to consumable parts, such as
batteries or protective coatings that are designed to diminish over
time, unless failure has occurred due to a defect in materials or
workmanship; (b) to cosmetic damage, including but not limited to
scratches, dents and broken plastic on ports; (c) to damage caused by
use with another product; (d) to damage caused by accident, abuse,
misuse, liquid contact, fire, earthquake or other external cause; (e)
to damage caused by operating the Apple Product outside
They're not going to cover damage caused by misuse and they're not obligated to replace parts to fix cosmetic damage made by the user, though they will if its is a manufacturing or design fault. Your attitude when dealing with the Genius/Repair Tech may influence the outcome so I advocate being polite, pleasant and not acting like you are entitled to extra service.
If the damage is as you describe, I doubt you'll have any difficulties. In general, it is my experience that Apple tries to err on the side of the consumer. If the damage is worse than you describe and the repair tech feels that it in some way responsible for the overheating, then service may be refused. If that happens and you feel this is unfair, escalate to the store manager and Apple Customer Relations as you feel appropriate. You can reach Customer Relations through just about any Apple support line by asking for that department by name.
In all likelihood, you're making a mountain out of a mole hill. Take the phone in and have an Apple tech have a look. You'll most likely be pleasantly surprised.
See also, Gigaom: Apple Tech Support Tips: 4 Steps to Bend Apple to Your Will
Danijel was right. The 0800 hotline did the trick. Apple was very willing to help and replaced the iPhone. Since it was only 13 months old and there were no damages, they handled it very quickly and without fuss.
Best Answer
This is a legal question, not a technical one BUT... the EU 'law' you are referring to is the European Directive 1999/44/EC. In the UK, the Sale of Goods Act meets or exceeds most of the directive's requirements, overriding the directive. The bottom line is, you are almost surely covered, do check what the Sales of Good Act says, see if these chaps chan help you
http://www.adviceguide.org.uk/consumer_e
and be ready to stir up as much trouble as you can. I once had to deal with a faulty screen in a new MBP, I did complain, they guys at Apple were not helpful, I kept complaining, calmly (you cannot ever lose it in these situations, because you give the opponent an excuse to stop dealing with you) and after 30 minutes the manager basically rolled belly up and did what I told him he had to do all along. Be prepared to ask to talk to mangers etc, and take note of times and names.