Lawmakers have agreed on legislation to extend expanded unemployment benefits for the long-term unemployed through the end of the year. Laid off workers would also continue to get subsidies to buy health insurance through the COBRA program.