Found it! This was a tricky one. I honestly thought for a bit that it was a misattribution or one of those quotes which seem to emerge from thin air at time to time, and then I stumbled across a citation in a Frank Lloyd Wright biography (of all damn things; thank you google books). It's from a book of poems called Twilight Songs (Les Chants du crépuscule), published in 1835 (I saw 1849 also, but only once. Likely a question of editions). The bit that's widely quoted is actually only the last stanza of a significantly longer poem (220 lines total) called "In the Church of..." ("Dans l'église de ***").
Now, the particularly ironic bit is that while that quote is all over the place, I can't find an English translation of the full poem anywhere on the internet, and Twilight Songs is completely out of print (it isn't even recognized as having existed by Amazon; maybe the French amazon would have it). I did find it in the original French, and I included that link with the sources (I can't read French at all but I ran it through enough translators to be certain that the last stanza is your quote). I did find your stanza cut out as an independent poem titled "A Simile" (also included with the sources) in the few English collections I could find on google books. I'm not sure what that's all about. From what I can tell, the collection is supposed to have around 40 works, but all of the translations I've found include only 20 or so: my guess is that they (or maybe Hugo) made significant cuts (maybe for the 1849 edition?). I've become curious about this myself, but I'm at a bit of a standstill here. I'm sure this has been written about, but all of that research would almost definitely be in French.
I hope this was helpful!
Frank Lloyd Wright bio (citation is on page 42)
"Dans l'église de ***" (French)
"A Smile" (English, Pg 113)