From an in-universe perspective...
According to Memory Alpha, Data is reciting from 'The (Curse of the) Black Orchid', which Whalen identifies as coming from Chapter 3. The full quote is as follows:
It was raining in the city of Angels -- a hard rain -- almost hard enough to wash the slime from the streets. But it never does. When the rain stops, the boulevard dries and the snakes once again slink from their holes. That's when my door opens and the helpless, the desperate, walk through with a heart full of hurt and a pocket full of nothing. It unearthed half-forgotten feelings the same way it dug up sleeping bones in shallow unmarked graves. It was that kind of day.
And now for an out-of-universe explanation about this
I've highlighted the relevant section we hear in the episode. Interestingly enough, it's not quite an exact recital!
The other interesting point Memory Alpha makes in linking to ST-Minutiae is that it seems there was a difference between the script and the actual episode. Here's the section in the script where Whalen identifies Data's recital:
DATA: It unearthed half-forgotten feelings the same way it dug up sleeping bones in shallow unmarked graves.(pause) It was that kind of day.
WHALEN (enthusiastic) Dixon Hill: "The Black Orchid," Chapter Three.
(Source)
Also, in the script, Data recites as seen in my above quote. The episode's transcript reads as:
DATA: Request permission to accompany you, sir. I am totally versed in the genre of the period.
PICARD: Well, shall we?
(Source)
Whereas the script says:
DATA: Request permission to accompany you, sir.
36 BACK TO THREE SHOT
The Captain is too surprised to respond.
DATA: I have mastered the lingo of the period. Example: (psuedo-Bogart) It was raining in the city of Angels -- a hard rain -- almost hard enough to wash the slime from the streets. But it never does. When the rain stops, the boulevard dries and the snakes once again slink from their holes. That's when my door opens and the helpless, the desperate, walk through with a heart full of hurt and a pocket full of nothing.
Further, in the script, Picard makes his speech to Jaradan and then the episode pretty much finishes there without Geordi asking Data what it was like, and Data then giving his recitation that we see in the actual episode.