Spanish Prime Minister Mariano Rajoy has said the government has agreed to formally ask regional authorities in Catalonia whether it had declared independence or not.