O2 UK iPhone 3G terms of service:
http://www.o2.co.uk/assets/O2HybridNav/Static-files/PDFs/O2airtimecontract1.pdf
Refer to section 11.1 entitled "Consumer Customers your right to change your mind"
If you purchased the iPhone directly from O2 (and for these purposes, this ought to include any O2-operated brick and mortar store), you have a 14 day grace period during which time you can choose to return the phone and cancel the contract.
This is a clause in a binding contract, and thus O2 must honour it in addition to any statutory rights you may have under regulations such as the Distance Selling Regulations.
Unfortunately, if you purchased the phone from any 3rd party distributor, then this clause in the contract doesn't apply to you.