This brings up the whole question of money in the Federation, do they have it or not. Here's what I think...
There have been references to something called "Federation Credits." These were mostly in TOS and TOS movies, such as "The Trouble with Tribbles," when Uhura offers to buy a tribble with credits, and "The Search for Spock," when McCoy attempts to use credits to book passage to the Genesis Planet. Once TNG came along, these references were dropped because Roddenberry was adamant that money did not exist anymore.
Then, there's the very specific reference in Voyager, in "Dark Frontier," that money went the way of the dodo on Earth in the twenty-second century. So, money both does and doesn't exist in the twenty-third century.
I reconcile this by believing that Federation Credits do, in fact, exist, even up to the end of "Star Trek Nemesis." However, they are only used when dealing with non-Federation races, or on the fringes of Federation society. Within the UFP itself, and especially within the Federation core of Earth, Vulcan, Andoria, and Tellar, money simply is unnecessary because technology provides everyone with everything they need to live comfortably.
All Federation citizens probably either have infinite access to credits or the ability to charge anything they want to some from of Federation bank. Then, when the time comes, and a non-Federation race demands that the bills be paid, the central Federation bank/government pays everyone's tabs.
That is how someone like Quark can still be paid by people who don't use money in their everyday lives. Once he has received his payment from the Federation bank/government, he converts that "money" into latinum.
And, of course, there's nothing stopping Starfleet officers, or other Federation citizens, from acquiring latinum of their own in one way or another, if they so chose.