Stock markets recorded small gains Friday even though oil prices continued to rise and a measure of consumer confidence indicated less optimism about the economy. The major indicators ended the week mixed.

Crude oil for September delivery closed up $1.08 per barrel, at $46.58, on the New York Mercantile Exchange. The University of Michigan reported that overall consumer confidence fell unexpectedly in mid-August.

"There's still a lot of uncertainty in the market right now, and coming in during such a traditionally slow month, there's just not a lot going on," said Michael Murphy, head trader with Wachovia Securities in Baltimore. "Valuations are appealing in a lot of sectors, but with the conventions coming up and oil dominating everything, big investors are just sitting on their hands."

The Dow Jones industrial average gained 10.76, or 0.1 percent, to 9825.35.

Broader stock indicators were also slightly higher. The Standard & Poor's 500-stock index was up 1.57, or 0.2 percent, to 1064.80. The Nasdaq composite index rose 4.73, or 0.3 percent, to 1757.22.

The major indicators were mixed for the week. The Dow ended the week up 10.02. The S&P 500 gained 0.83. The Nasdaq fell 19.67.

"The big concern continues to be the price of oil and whether it'll continue its march to $50," said Keith Keenan, vice president of institutional trading at Wall Street Access. "If this keeps up, economic growth is going to be far weaker than people are expecting in the second half. But if you get an appreciable drop in oil, this market's going to rip higher."

Tech stocks received a small boost from Dell, whose high expectations for 2004 were a relief from the disappointing outlooks from Hewlett-Packard and Cisco Systems earlier in the week. Dell rose $1.39, to $34.51, after matching Wall Street expectations in its second-quarter profit. The computer maker said its third quarter, the back-to-school season that drives much of the personal technology industry's profit, looked positive.

Software maker Agilent Technologies rose 84 cents to $20.52 after announcing a third-quarter profit, compared with a loss in the same the quarter last year.

Other Indicators

* The New York Stock Exchange composite index rose 17.78, to 6234.84; the American Stock Exchange index rose 7.35, to 1210.01; and the Russell 2000 index of smaller-company stocks rose 0.29, to 517.39.

* Advancing issues outnumbered declining ones by 7 to 5 on the NYSE, where trading volume fell to 1.17 billion shares, from 1.4 billion on Thursday. On the Nasdaq Stock Market, decliners narrowly outnumbered advancers and volume totaled 1.41 billion, down from 1.61 billion.

* The price of the Treasury's 10-year note rose $1.25 per $1,000 invested, and its yield fell to 4.23 percent, from 4.25 percent on Thursday.

* The dollar fell against the Japanese yen and the euro. In late New York trading, a dollar bought 110.57 yen, down from 110.89 late Thursday, and a euro bought $1.2373, up from $1.2241.

* Gold for current delivery rose to $398.90 a troy ounce, from $394.30 on Thursday, on the New York Mercantile Exchange's Commodity Exchange.