NEW YORK, JAN. 29 -- Stock prices registered widespread gains today, despite the market's uncertainty about the direction of the economy, analysts said.

Trading was active, supported by the continuing bond market rally, but with special attention focusing on issues due to pay dividends soon.

The Dow Jones average of 30 industrial stocks closed at 1958.22, up 28.18 points, marking a gain of 54.71 for the week.

Advancers outnumbered decliners by about 5 to 2 on the New York Stock Exchange. Big Board volume totaled 211.88 million shares, of which five dividend-related issues accounted for more than 60 million shares.

Today marked the last trading day of January, and -- in an appropriate reflection of the month's volatility -- it took the session's performance to determine whether the month would be a net winner or loser for some of the leading market indicators.

Some Wall Streeters like to keep track of that result, dubbed the "January Barometer," as a harbinger for the rest of the year.

Yale Hirsch, writing in the 1988 Stock Trader's Almanac, said that in 32 of the past 37 years -- or 86 percent of the time -- the market has basically followed suit with upward or downward moves in the Standard & Poor's composite index for January.

The result this year? A net 9.99-point gain from Dec. 31 through January in the Standard & Poor's composite index.

The Dow Jones industrials also showed a net gain -- 19.39 points -- over the month.

Today's session opened with an updraft that accompanied the continuing rally on the bond market. Still, many stocks fell back by midday, as trading slowed, only to pick up again, especially in the last hour.

Many interest-sensitive issues showed healthy gains.

Among banks, Chase Manhattan was up 1 3/4, at 22 7/8; J.P. Morgan was up 3 1/8, at 37 1/8; and Morgan Stanley picked up 7/8, at 50 1/4.

Dividend-related shares were particularly active during the session.

Among these, Tenneco led the Big Board's most-active list, up 1/4 at 40 1/4; Public Service of New Mexico was up 1/4 at 22 1/4; American Electric Power was up 7/8 at 29 3/4; Union Carbide was unchanged at 20 3/4 and Merrill Lynch gained 3/4 at 24.

Among other issues, oils were strong, with Amoco up 1 3/8 at 74 3/4; Atlantic Richfield up 1 3/4 at 74 7/8 and Mobil up 1 1/8 at 44 1/8.

IBM was down 1 3/8 at 112 3/8; Digital Equipment was down 1/8 at 123 3/8 and Honeywell was up 3/4 at 61 1/2.

Nationwide turnover in NYSE-listed issues, including trades in those stocks on regional exchanges and in the over-the-counter market, totaled 250.92 million shares.