No need to restrict yourself to two companies but broadly speaking there are two ways of doing this:
Buy a handset outright and get a separate SIM only deal. This is what I do, you can get a handsets from £50 to more than £1,000 (if you want the latest iPhone). It depends on your budget, what you want etc. A SIM only deal shouldn't need to cost more than £10 (in fact a quick search reveals many at around £6 - the key thing isn't the minutes or texts (they're unlimited on practically every deal these days), it's the data that matters.
Alternatively you could get a contract that includes the handset. These usually last 18 or 24 months, and cost from around £10 for a bottom of the range handset to around £80 a month for the latest iPhone - basically you're paying the cost of the handset as a loan agreement over the term of the contract although you do need to remember that the cost also includes your SIM cost as well. If you do go down this route make a diary note of when the contract expires so you know to cancel it and move to a SIM only deal at that point otherwise (depending on the company) you continue to pay the full price!