Pakistan takes part in talks to end Afghan war