At least 50 people were killed when a suicide bomber blew himself up at a mosque in northeast Nigeria, police said, in an attack blamed on Boko Haram jihadists.