A Turkish court has ordered Facebook to block pages deemed insulting to the Prophet Mohammed, and has threatened to shut down the social media network if it ignores the directive, state media says.