Campaigners fighting the Ministry of Justice over a ban on books being sent to prisoners on Monday threatened to take their battle to the courts.

The leading human rights lawyer Geoffrey Robertson QC, who has offered his services for free, said legal action could be taken against the justice secretary Chris Grayling for acting "unlawfully and irrationally".

Robertson said it could be argued that Grayling was breaching the 1688 Bill of Rights by taking it upon himself, as a politician and not a judge, to inflict "cruel and unusual punishment" on literate prisoners.

"Grayling is not a lawyer, he is a politician who seems to think he is above the law," said Robertson, joint head of Doughty Street Chambers. "He has no power to impose additional punishment on prisoners over and above that which is imposed by the courts. The action has nothing to do with prison security or any other legitimate purpose.

"The right to read is precious in this country and for prisoners it is a way to lift themselves out of the slough of criminality. To deny them the books they need in order to improve themselves is both unreasonable and counter-productive."

His intervention came as Nick Clegg said he would be the first to demonstrate against a ban on books in prison but insisted that the new rules did not amount to such a ban.

The deputy prime minister told his monthly press conference: "If there was a ban on sending books to prisoners, I would be the first to demonstrate outside the local prison. It would be ridiculous. It's outrageous … Education, and training, reading and learning are a crucial part of [rehabilitation].

"But the measures being proposed are not about banning books, they are about making sure the security arrangements around packages delivered to prisoners are applied consistently across the prison estate. Anyone can send books to the library of your local prison. Prisoners can take any books. They can keep books in their cells. I would encourage them to do so.

"I am a total fellow traveller with the campaigners who are worried that this is going to impact on the chances of prisoners to be rehabilitated. I just so happen to think in this particular instance they are firing at the wrong target. This is about a very operational decision but we make sure packages are not used to circumvent the rules of the prison estate and that is evenly applied."

The campaign against the measure is gathering pace. On Friday writers and actors – including the poet laureate Carol Ann Duffy, David Hare, AL Kennedy, Vanessa Redgrave and Sam West – protested outside Pentonville prison.

A campaign by the Howard League for Penal Reform has been backed by some of Britain's biggest literary names including Alan Bennett, Salman Rushdie, Julian Barnes, Ian McEwan, Philip Pullman and Ruth Padel.

Chief executive Frances Crook, chief executive of the league, said: "The MoJ should recognise this policy is flawed and the ban on loved ones sending in books and other essentials to prisoners has little or no support from anyone with an ounce of common sense.

"Reading books goes hand in hand with education, with rehabilitation, with humanity. The spurious arguments in favour of this measure simply don't stand up to scrutiny."

She said it was with regret that legal action was being considered. "We still hope that the MoJ will see sense and work with us to resolve the unintended consequences of this policy," she added.

New rules came in to force in November preventing prisoners from receiving parcels from the outside unless they have "exceptional circumstances", such as a medical condition. Books, subscription magazines and clothing are all prohibited.

Grayling has defended the rules in an open letter to Duffy. He said there had been no policy change and that it was a ban on prisoners being sent parcels that was being applied across the whole system. He said "the arrival of thousands of unknown parcels in our prisons each day, whether containing books, essential items or anything else", would undermine the prison service's battle against drugs.

The campaign against the policy is being supported by English PEN. Its director Jo Glanville said: "Through our work in prisons, we've seen at first hand the necessity of access to learning and literature. The government needs to review its short-sighted policy urgently.

"This is a counter-productive measure that has shocked the public and the literary establishment, and we're very disappointed by ministers' response to the campaign."