The president of Pakistan has declared a state of emergency in the country's northwestern Khyber Pakhtunkhwa province.