The dividend yield, a measure of a company's dividend compared with its stock price, is 3.6 percent for utility companies in the S&P 500. That compares with a dividend yield of 1.5 percent for technology companies and a yield of 2.71 percent for 10-year Treasury notes.
"The dividends will provide you with some support," says Phil Orlando, chief equity strategist at Federated Investors. "Those names will go down less than the names that don't pay dividends."
Exelon, a Chicago-based utility is up 31 percent this year and PSgEG, a utility based in New Jersey, has gained 23 percent.
Gold has also been one of the year's best-performing financial assets, climbing 6.8 percent to $1,284 an ounce. The price of the metal is rebounding after a 2013 slump of 28 percent, its biggest decline in more than 30 years.
Read MoreNine lovable losers investors can't resist
Investors have also been buying gold as a hedge against a weakening dollar. The U.S. currency has dropped against the euro and the Japanese yen this year as the Federal Reserve has reiterated its message that it will continue its efforts to support the economy with low interest rates.
"We still view gold as one of the best alternatives, if the base case of U.S. economic growth and continued equity price appreciation stumbles," says Mike McGlone, director of research at ETF Securities. "And so far, that is what has happened."
Demand for gold as a safe asset has also risen as tensions between Russia and the West have escalated over Ukraine. Russia annexed the Crimea region on March 21.