The Postal Services Act 2011 allows them to charge a fee and to withhold any such item pending payment.
This is the odd bit, as whilst they claim they can, they can't really as they would have to return to sender if enough time passes, thus they would be directly obstructing the receipt of your mail due to having held it for ransom.
I have had this issue with them myself, I have had them admit that I am liable for nothing as there is no contract between myself and them, and I have walked out with my parcels on more than one occasion without having paid them a penny, and that includes not reimbursing them for the customs fees they paid. This was because they were being so stubborn that they wouldn't accept ANY payment without their handling fee, so I opted for no payment at all.
It's easily enough to argue them in to submission that they bring your parcel out and hand it to you, which I did, and there is no chance they are going to attempt to take it back out of your hands, despite them telling me I couldn't leave without payment, they didn't attempt to stop me.
They sent me two letters threatening police action, and threatened that they were going to call the border agency on me due to non-payment of customs fees, despite it being a completely civil matter.
I found their letters extremely amusing because they knew I knew my rights, but still tried it on by using "police" and "UK Border Agency" as threats.