Apple has deigned to allow apps that use your iPhone 4's LED flash as a flashlight into the App Store. Some cost money, others do not. Some are well-designed, some not so much. But they all pretty much work.
There are already like 50 other flashlight apps available, most costing $1, and many of which look quite nice. I'm partial to Ultimate Flashlight, which sports a color-customizable Maglite-style textured grip UI and an SOS mode that blinks the LED. If you're looking for something that gives you a little more control (though a little less visual polish), Actual LED Flashlight lets you change the speed of the flashing strobe effect.
LED Torch Light won't win any design awards, but it's free, and for something like this, that's about all it takes. Update: FlashLight4G is also free and has a pretty icon, too. That's not unimportant!
Turning your iPhone into a little LED flashlight will undoubtedly be handy at some point. If you just want to be sure you have something to turn that flash on when the power goes out, LED Torch Light should suit you fine. If you want one that's pretty to look at, too, check out Ultimate Flashlight or one of the many other $1 options. [Actual LED Flashlight, Ultimate Flashlight, LED Torch Light]