Pakistani militants have fired outside a mosque in Pakistan, killing nine people and injuring 27 in the western city of Quetta, Baluchistan Province.