A powerful 6.3 magnitude earthquake has struck northern Afghanistan, killing at least 20 people and injuring over 640 others.