If you haven't contacted them about an upgrade you'll receive a text message from O2 when you've paid your final bill of the contract with a number to ring about upgrading. I didn't realise this until the time and was pretty chuffed to be able to upgrade to the
N95 8GB after 17 months of the previous contract!