You are liable for the rent until the end of the contract.
3 ways to end a tenancy contract within the fixed term
1. mutually agreed surrender
2. use a break clause that will be written into the contact
3. landlord evicts using the courts.
Thats the only 3 ways
Steve I assume you work for shelter and know your onions, but I want to disagree with you slightly here. Whilst technically you may be correct practically you are a slightly off. I'm a landlord and have some hands on experience with tenants and the courts in solving these issues.
If he walked out today the landlord should make reasonable steps to re-let the property asap, and whatever his costs (lost rent advertising etc) the tenants is then liable for, if he just sat back and waited until the tenancy was up without trying to re let and then tried to sue the tenant for all the lost rent the courts will not accept his claim. Although if he can prove he made reasonable efforts to let and could not let it for the whole period then yes the tenant would be liable for the whole period.
OP if you are insisting on leaving, talk to the landlord and let him know, then ensure you put it all in writing, and take the hit on costs. I'm a landlord and I'm reasonable, if you covered my costs so that I wasn't out of pocket due to you leaving early then I'm happy.