Despite criticising "segregated" education, Prime Minister David Cameron has defended the continuation of faith schools in a speech on counter extremism.

In a wide-ranging speech, delivered in Birmingham, Mr Cameron set out his thinking on how to confront extremism and Islamist ideology and rejected what he called the "grievance justification" for Islamist violence.

He talked about Britain as a "multi-racial, multi-faith democracy" and as a "beacon to the world". He said no-one should be demonised but said there was a need to "confront, head on, the extreme ideology" behind Islamism.

He said that Britain needed to be bolder in asserting "liberal values", which he called "our strongest weapon".

The Prime Minister issued a strong challenge to "the cultish worldview" of extremists and the "conspiracy theories" that support it, and he said the UK should contrast the "bigotry, aggression and theocracy" of the Islamists with our own values."

Mr Cameron indicated that funding would be made available for groups willing to lead reform and spread an "alternative narrative". He also committed to do more to tackle extremism in prisons.

Turning his attention to the newly introduced "Prevent duty" for public sector bodies, Cameron said that it is "not about criminalising or spying on Muslim children" and accused some of its opponents of "paranoia in the extreme."

However, despite warning that "the education that our young people receive" in schools in "divided communities" is "even more segregated than the neighbourhoods they live in", David Cameron said the UK should not "dismantle faith schools."

Instead, he said "it is right to look again more broadly at how we can move away from segregated schooling in our most divided communities." The Prime Minister suggested that faith schools could share sites or facilities.

"It cannot be right that children can grow up and go to school and not come into contact with people of other backgrounds [and] faiths," he said.

Research by Demos recently found that "some faith schools effectively exclude other ethnic groups" and that minority faith schools were particularly segregated.

NSS campaigns manager Stephen Evans said, "Much of this speech is very welcome – and echoes what secularists have been saying for a long time. But it is blinkered to ignore the role that faith schools play in creating the segregated communities that Mr Cameron rightly criticises. The potential of faith schools to exacerbate the separation of communities is obvious for all to see.

"Children from different backgrounds need to mix with each other on a daily basis if we are to break down the barriers. They will never truly understand and trust each other if their schools are encouraging an us-and-them mentality. Tinkering round the edges with occasional visits and shared resources is not good enough – in fact it can be counterproductive, reinforcing the feeling of being from different worlds."

The Prime Minister also said action was needed on unregulated religious 'schools', an issue previously raised by the NSS.

On hate preachers and Islamist speakers invited onto university campuses, the Prime Minister said: "When David Irving goes to a university to deny the Holocaust university leaders rightly come out and condemn him. They don't deny his right to speak but they do challenge what he says."

In contrast, Cameron argued that university leaders "look the other way through a mixture of misguided liberalism and cultural sensitivity" when Islamist speakers attend university events.

He also issued a strong rebuke to the National Union of Students.

"When you choose to ally yourselves with an organisation like CAGE, which called Jihadi John a 'beautiful young man' and told people to 'support the jihad' in Iraq and Afghanistan," he said, it brings "shame" to your organisation and "your noble history of campaigning for justice."

The Prime Minister cited the review of sharia 'courts' among measured to crackdown on non-violent extremism, and promised a consultation on lifetime anonymity for victims of forced marriage, in a proposal welcomed by the National Secular Society.

He spent much of the speech dealing with non-violent extremism, and argued that "if you say 'yes I condemn terror – but the Kuffar are inferior'… then you too are part of the problem."

Terry Sanderson, president of the National Secular Society, said: "This all sounds very familiar, and we are glad that the Prime Minister is catching up with the NSS's thinking and suggestions. All he has to do now is carry out his plans, which may be more difficult than he thinks. There is a lot of resistance not just from the Islamists but from the liberals who imagine that taking a stand against the Islamist threat is equivalent to attacking all Muslims. It is not and for all our sakes we must not be put off tackling the bad guys for fear of offending the good ones."

The Government will publish its counter-extremism strategy in the autumn.