No, the Queen did not say that. I think it comes from a recent book about her. In an interview for the book, she is asked what she thinks about islamic fundamentalism (not the religion Islam) and groups who want to replace the democracy with sharia-law and such. She says with a Danish word that is hard to translate, but something to the effect of "you should speak against that",
There was some critic about her saying that, because she normaly never does and it could be misinterpreted. I havn't read the book, but I have heard it is a very open and honest book about Margrethe II and based on interviewes with her.