I did have exactly the same problem as this. It's actually a problem with O2 rather than the iPhone itself.
I spent almost 2 weeks getting O2 to firstly find out what was wrong and secondly to fix it.
At the most basic level, make sure it's enabled by dialing 1750 to ensure that voicemail is enabled. If Visual Voicemail doesn't work still then you will have to call O2.
Basically in my case, because I had ported my number from an existing O2 account to the new iPhone O2 account the provisioning didn't get setup properly (and is apparently affecting a few O2 porters), but they didn't have the business logic in place to allow this to be done by customer services yet and there was only one guy in the whole company that could manually push through the provisionings (so the Customer Services guy who called me about twice a day updating me!).
Now this is where it gets awquard. I found a few days ago my visual voicemail just suddently started working, however I discovered that O2 had CHANGED my phone number without telling me and disconnected my old number. As you can imagine I wasn't please. However Customer Services did manage to configure my original number back again, thank goodness, and visual voicemail still works afterwards! One happy customer (after getting some freebie months for them disconnecting my number)