Richard G. Olson, the Obama administration’s special representative for Afghanistan and Pakistan in 2015 and 2016, pleaded guilty on Friday to federal charges in connection with a behind-the-scenes effort to exert influence with the Trump administration.