The Obama administration has drafted an executive order that would give the president the power to detain terrorism suspects indefinitely, according to three senior government officials with knowledge of the decision.