S&P 500, Nasdaq edge higher amid U.S.-EU trade deal