A bit depends on the current phone, I'd say. While I'm not a particular fan of the iPhone, I know a friend of my sister was able to get a significant sum from the network to return his old handset when he upgraded to a new one (another iPhone).
In terms of phone in a contract, and buying outright, then it depends on the cost of the phone. If you're after a new, top of the range, model, that costs from 400 up, it may work out best on contract (or even only be available on contract, in some cases).
SIM Only contracts can be great value, and the SIM will be usable with any (suitable) phone. The phone needs to be either unlocked or on the network for that SIM, and my advice would be that depending on what you want as your next mobile, it might be worth shopping around and considering options.
For example, if you stick with the same network, you may find they don't supply the mobile phone you'd really like. If you have an old unlocked phone as an emergency, you could consider moving your number {just briefly} to any other network {on PAYG} and then see what deal looks best afterwards. You can check the various stores like Phones4U and Carphone Warehouse (and online, affordablemobiles, e2save.com and so on) and if you find the phone you want, on contract with the network you want, then even if the network don't offer that phone, you can get it via other route (eg e2save)
DO NOT REQUEST CANCELLATION of the contract - ask for your PAC (Porting Authorisation Code) which gives the network notice you want to take your number away to another network (the PAC is only valid for 30 days so ask for it when you are at start of 30 days before contract ends). That request triggers their Retentions team to ring, to try to keep you as a customer of the network.
NB If you ask to CANCEL, some networks are awkward about issuing the PAC. I had to go to OFCOM and back to the HQ of the network, to get them to issue me with a PAC, because their system could not issue a PAC if I was cancelling (I blame their system, or that they decided to make it that way to be bloody-minded for the sake of it!)
If you do end up leaving, expect a couple of "final" bills. One will be for any final charges (if applicable) and the second will be maybe 2-4 weeks later (in case you used your mobile abroad in the final month, and the network has just received data from overseas for your usage).
Some people negotiate a price reduction and/or a lower cost for some mobile (compared with pricing on the web site). If you have seen what other networks are offering, and for how much, it helps so you can tell your network what a poor deal they are offering.
Finally if you do switch to a PAYG (keeping your mobile number), then look out for some of the cashback deals from TopCashBack or Quidco, as you would be starting as a new customer even if you went back to the same network, eg on a SIM Only deal, or with a new mobile phone.