This quote is actually attributed to Vyacheslav von Plehve, the minister of interior during Nicholas II reign (and, AFAIR, marked as such in the beginning of David Weber's book).
The quote comes from memoirs of Sergei Witte, who was Russian prime minister in 1903-1906. Witte writes the following
Plehve <...> said to [minister of war Aleksey Kuropatkin]:
"Aleksey Nikolayevich, you do not know the internal situation of Russia. To hold down the revolution, we need a short victorious war."
(emphasis in the original)
Witte's memoirs were published posthumously in 1921. The quote from Plehve first appeared in a 1911 pseudonymous pamphlet criticizing Plehve and praising Witte (which may have been written on Witte's order, too.)
Worth noting that Witte and Plehve were political rivals, so we should probably take anything one wrote about the other with a grain of salt. Anyway, the quote dates back to the times of Nicholas II but is attributed to the tsar's minister, not to the tsar himself.