At least eight people are dead, and a child injured, after a 5.9 magnitude earthquake hit parts of Afghanistan and Pakistan late on Friday.