Politics and money.
NOTE: if you have not completed the series, SPOILER ALERT.
First, politics: Illyrio's refusal to bow to the law of Pentos is symbolic of his character. He believes himself above those laws. Second, money: Illyrio is probably a slave trader, so the household slaves aren't necessarily the extent of his slaveholdings.
The matter is revisited twice in A Dance With Dragons. First, in chapter 2:
"Slaves?" the dwarf asked pointedly. The fat man stroked one of the prongs of his oiled yellow beard, a gesture Tyrion found remarkably obscene. "Slavery is forbidden in Pentos, by the terms of the treaty the Braavosi imposed on us a hundred years ago. Still, they will not refuse you."
Illyrio is allied with the Targaryens, and believes that their rule is the future. In other words, he believes that he is bigger than Pentos. Further, pointing out that the law comes from Braavos, not from Pentos, implies that the law is unnatural to Pentos. That then is justification for ignoring it.
Illyrio's relationship with slavery is expanded on in chapter 5:
Tyrion pondered all that he knew of Volantis, oldest and proudest of the Nine Free Cities. Something was awry here. Even with half a nose, he could smell it. "It's said that there are five slaves for every free man in Volantis. Why would the triarchs assist a queen who smashed the slave trade?" He pointed at Illyrio. "For that matter, why would you? Slavery may be forbidden by the laws of Pentos, yet you have a finger in that trade as well, and maybe a whole hand. And yet you conspire for the dragon queen, and not against her. Why? What do you hope to gain from Queen Daenerys?"
(Emphasis added)
Illyrio responds with:
"The Beggar King swore that I should be his master of coin, and a lordly lord as well. Once he wore his golden crown, I should have my choice of castles... even Casterly Rock, if I desired. [...] My manse is large enough for any man, and more comfortable than your drafty Westerosi castles. Master of coin, though..."
This exchange reveals why Illyrio is helping the Targaryens. It also, however, reveals that Illyrio is not only a slaveholder, but also probably a slave trader. It is, then, a source of his wealth - and as the passage just illustrated, Illyrio will go very far, and take many risks, for money. Even defying Pentos law.
Edited to add: In answer to your second question, no: the danger/consequences of discovery are never mentioned. This supports the reader's impression of Illyrio as a powerful man, to have no concern about breaking the law.