At least 50 people are dead and almost 100 are injured after a powerful explosion in a mosque in northern Afghanistan.