At least 14 people have been killed in a suicide bombing that targeted protesters at an anti-militant rally in northwestern Pakistan, officials say.