Am I able to buy a new O2 contract for a new O2 locked iphone 5?

I'm about to buy a brand new Iphone 5 O2 locked and as a result planning on buying an O2 contract separately. I was wondering whether there would be any problems.
I know this may sound really simple, but I don't want to end up buying this new iPhone and then not being able to buy a contract for it.

It will be fine as long as you pass the credit check which is much easier to do if you only require a sim deal because you are not taking out a contract handset, those credit checks are more difficult because obviously they are providing an expensive phone and in effect it is a loan.

Why not call o2 and ask them to run a check just to be sure? They are usually absolutely fine doing this, aside from that there will not be any problems.