David Cameron has broadened the terms of the inquiry into the conduct of the media to include the BBC and social media.

The prime minister was setting out the formal terms of reference of the inquiry to be led by Lord Justice Leveson, an appeal court judge. The inquiry has become something of a behemoth, leading Don Foster, the Liberal Democrat media spokesman, to assert he could not see how it could be completed within its timetable of a year.

Cameron also announced in the Commons that he would like to see politicians taken out of all future decisions on media takeovers, and the media regulator, currently Ofcom, given powers to intervene not just at the point of a takeover but also when a paper or media group developed a more dominant position.

He gave details of a panel of advisers for Leveson including Shami Chakrabarti, the director of Liberty; Sir Paul Scott-Lee, the former chief constable of the West Midlands police; Lord Currie, the former Ofcom chairman; Elinor Goodman, the former political editor of Channel 4 News; George Jones, the former political editor of the Daily Telegraph; and Sir David Bell, the former chairman of the Financial Times.

Cameron did not appoint a tabloid journalist, even though many of the issues apply to the redtops.

The inquiry has been asked to make recommendations for "a new, more effective policy and regulatory regime which supports the integrity and freedom of the press, the plurality of the media and its independence including from the government, while encouraging the highest ethical and professional standards".

The second part of the inquiry will look at the failures of the police investigation into unlawful conduct at News International, the extent of unlawful conduct at News International and other media organisations, the extent to which police received corrupt payments, and the extent of management failures at News International and other news organisations.

Foster expressed concern that one motive for the extension of the terms of reference, judging by the remarks of Tory MPs, may be to clip the BBC's wings.

Leveson said: "The inquiry must balance the desire for a robustly free press with the rights of the individual, while at the same time ensuring the critical relationships between the press, parliament, the government and the police are maintained. At the heart of this inquiry, therefore, may be one simple question: who guards the guardians?"

He confirmed hearings would be held in public and he is expected to call for the first tranche of evidence within weeks. "I must emphasise that this inquiry cannot cut across or prejudice the ongoing criminal investigations or any subsequent prosecutions. It is for that reason that the specific questions identified in part two of the terms of reference almost inevitably cannot presently be pursued," he said.

Giving his most detailed thoughts so far on the future of media regulation, Cameron said media ownership rules could be changed to avoid any organisation holding too much sway. He said: "We need competition policy properly enforced. We need a sensible look at the relevance of plurality and cross-media ownership.

"Above all we need to ensure that no one voice, not News Corporation, not the BBC, becomes too powerful.

"I think we should be frank: I think in this country sometimes the left overestimates the power of Murdoch, the right overdoes the left-leanings of the BBC.

"But both of them have got a point and never again should we let a media group get too powerful."

He said changes should be considered so that politicians were removed from making decisions about media ownership.

It should be considered whether the "plurality test" should be a constant issue, rather than only arising when a takeover is considered.

Leveson's inquiry should consider whether the size of a media organisation could be capped, Cameron added. "While plurality is difficult to measure, especially in the modern internet age, we shouldn't rule out the idea of limits and I think it is right the inquiry should look at this issue."

The idea of trying to define plurality numerically has been promoted by the deputy prime minister, Nick Clegg, and the business secretary, Vince Cable.

Politicians from "governing parties eager to hold on to power" or "opposition parties yearning to win power" should not duck issues of media regulation, Cameron added. He said parliament needed to proceed on a cross-party basis, otherwise each party would promise media outlets the "lowest common denominator".

"If I say 'independent regulation', there's a danger someone else will say 'self-regulation' and so on," he said.

"We could end up constantly competing with each other in a kind of regulatory arbitrage over who can be the softest and most appealing to newspapers, television stations and owners."

He said there had come a time in recent years when the income of the BBC was "so outstripping that of independent television, there was a danger of BBC News becoming rather dominant".

Cameron also said he had asked the cabinet secretary to write to all permanent secretaries to ask them to review the way contacts between the media and their staff and other professional groups that work with their departments are regulated and recorded.

"We see there is a problem with the police and the media. We need, I think, to get ahead of there possibly being problems with other groups as well," he said.

Ed Miliband, the Labour leader, announced that he would publish details of all his meetings with media executives since the general election.