SAN FRANCISCO — Yelp Inc. narrowed its second-quarter loss as it attracted more reviews and visitors, and website raised its sales forecast for the year Wednesday.

The quarter's loss was smaller and revenue growth was bigger than analysts had expected. Yelp shares gained more than 5 percent in after-hours trading.

Yelp is getting clicks, helping it increase its ad sales. It drew 108 million unique visitors per month in the second quarter, a 38 percent increase from a year earlier. It's also adding content, with 42.5 million total reviews, up 41 percent from a year ago.

But it's still losing money. The company reported a loss of $878,000, or a penny per share, compared with a loss of $2 million, or 3 cents per share, in the April-June period last year. Revenue soared 69 percent to $55 million.

Analysts expected a loss of 4 cents per share on $53.3 million in revenue, according to a FactSet survey.

The San Francisco company predicted revenue of $58 million to $59 million in the third quarter revenue and raised its outlook for the year to $222 million to $224 million from its previous guidance of $216 million to $218 million.

Both would slightly beat the forecasts of analysts, who were expecting $57.3 million in the September quarter and $219.8 million for all of 2013.

Yelp is trying to expand its presence on mobile devices, where Yelp users conduct about 59 percent of their searches. It's also launching features to draw advertisers to the site, and this month it acquired the SeatMe app used to reserve seats in restaurants.

The company is also spending much more as it grows. Sales and marketing costs rose 52 percent to $30.8 million, while research and development expense jumped 86 percent to $8 million and overhead costs climbed 69 percent to $10.1 million.

The stock ended regular trading up a penny at $41.80. Shares have more than doubled this year. In aftermarket trading Wednesday, they added $2.25, or 5.4 percent, to $44.05.