The president and his allies pushed senior Justice Department officials to overturn the election results and keep him in power, documents show.