House Speaker Paul D. Ryan said Wednesday that he will retire from the House at the end of this year, closing out a two-decade career in Congress and igniting soul-searching in a party bracing for a rough election season. Mr. Ryan rejected claims that he was fleeing a sinking ship. He predicted that Republicans will keep…