President Musharraf is trying to maintain cooperation with Washington in the fight against terrorism while managing opposition to his government by Islamist hardliners .