Dozens of people have died after days of clashes between rival sectarian groups in Pakistan.