Ed Miliband has ruled out support for an in-or-out referendum on Britain's membership of the EU on the terms proposed by David Cameron in his speech on Europe.

In an attempt to deflect criticism from Downing Street, which is accusing Labour of lacking a policy on the EU, Miliband said he was against an in-or-out referendum.

His remarks at prime minister's questions came shortly after Nick Clegg criticised Cameron for creating "years of grinding uncertainty" by pledging to hold a referendum by the end of 2017. Cameron told an audience at the London headquarters of Bloomberg that, if he won the 2015 election, he would renegotiate Britain's EU membership terms. This would then be put to a referendum.

The prime minister, who accepts Clegg will disagree with him, believes the Labour party is equivocating on a referendum. But challenged by Cameron at prime minister's questions whether he supported a referendum, Miliband replied: "Our position is no: we don't want an in-out referendum. My position is precisely the same as his position when we voted together in October 2011 against an in-out referendum. My position hasn't changed. It is his position that has changed."

The unequivocal statement by Miliband marks a hardening of Labour's position that will leave him little room for manoeuvre at the general election when the Tories pledge to offer a referendum by the end of 2017. In an interview on the Andrew Marr Show on BBC1 on 13 January, the Labour leader ruled out a referendum "now" but declined to speculate on "years hence".

The prime minister appeared not to have heard Miliband's response when he claimed that the Labour leader still had not clarified his position on a referendum. "I have politely to say to [him] his whole argument about there being uncertainty is fatally undermined by the fact that he cannot answer whether he wants a referendum or not. Can I give him a little bit of advice? He needs to go away, get a policy, come back and tell us what it is."

Miliband had earlier claimed that the prime minister was being "dragged by his party" in a Eurosceptic direction. "Why doesn't he admit it? He is being driven to it not by the national interest but being dragged to it by his party."

The Labour leader also challenged the prime minister to say whether he would campaign for a no vote in the referendum if he failed to secure acceptable new EU membership terms. The prime minister declined to answer Miliband's specific point as he said: "I don't want Britain to leave the EU. I want Britain to reform the EU."

The deputy prime minister, who was briefed by Cameron on his speech, said he disagreed with the strategy. He told Sky News: "The biggest challenge which is facing our country is that we have a fragile economy which is taking time to recover. That's why my priority, certainly the priority of the Liberal Democrats, is to build a stronger economy in a fairer society. Now, that job is made all the harder if we have years of grinding uncertainty because of an ill-defined, protracted renegotiation of Britain's status within the European Union. That in my view will hit growth and it will hit jobs and that's why in my view it's not in the national interest."

Clegg said a referendum may be necessary in the future. But he said it was wrong to call for a renegotiation now.

The prime minister, who was greeted by Tory MPs waving their order papers as he arrived in the Commons, was praised by Tory MPs across the party. Sir Gerald Howarth, the Eurosceptic former defence minister, said: "May I congratulate [you] on a landmark speech demonstrating serious leadership of our country and leadership on the important issue of Europe."

Bill Cash, the veteran Eurosceptic Tory, said: "[The prime minister] insists on five excellent principles including democracy based on national parliaments and he rejects ever-closer union."

The prime minister mocked Sir Menzies Campbell, the former Liberal Democrat leader, after he called on Cameron to invite the veteran Tory pro-European Lord Heseltine to conduct an inquiry into the consequences of British withdrawal from the EU. Cameron said he disagreed with Heseltine on the EU, adding: "On the issue of the referendum I would gently remind [you] an in-out referendum was very much part of [Campbell's] manifesto at the last election. But in the interests of coalition harmony I think we will leave that to one side."

The Lib Dem manifesto actually said that such a referendum should be held "the next time a British government signs up for fundamental change in the relationship between the UK and the EU".