Speaking or talking while relieving oneself is disliked unless done out of necessity or to warn of danger.

Istinja: Restroom Etiquettes, Sunnahs, and Disliked Places