Suspected militants have opened fire on a police vehicle in Pakistan's northwest, killing five officers.