Banks and tech companies lead US stocks to slight gains