Stocks closed slightly higher Thursday, nudging the Nasdaq composite index to a record high.

Banks led the gainers for the second day in a row amid speculation that the Federal Reserve will raise interest rates next week. The sector also got a boost as lawmakers moved to undo stricter regulations placed on banks following the 2008 financial crisis. Utilities and consumer goods companies were among the biggest decliners.

On Thursday:

The Standard & Poor’s 500 index rose 0.65 points, or 0.03 percent, to 2,433.79.

The Dow Jones industrial average added 8.84 points, or 0.04 percent, to 21,182.53.

The Nasdaq composite gained 24.38 points, or 0.4 percent, to 6,321.76.

The Russell 2000 index of small-company stocks picked up 18.94 points, or 1.4 percent, to 1,415.61.

For the week:

The S&P 500 is down 5.28 points, or 0.2 percent.

The Dow is down 23.76 points, or 0.1 percent.

The Nasdaq is up 15.97 points, or 0.3 percent.

The Russell 2000 is up 10.23 points, or 0.7 percent.

For the year:

The S&P 500 is up 194.96 points, or 8.7 percent.

The Dow is up 1,419.93 points, or 7.2 percent.

The Nasdaq is up 938.65 points, or 17.4 percent.

The Russell 2000 is up 58.48 points, or 4.3 percent.