A powerful earthquake has rattled northern Afghanistan, killing more than a dozen people, injuring hundreds and damaging one the country’s most beautiful mosques.