The voidmind template says:

Attacks: A voidmind creature gains a tentacle attack. At will, the creature can extrude a tentacle (resembling an oversized mind flayer tentacle) from the psionic slime in the creature's skull. This tentacle sprouts from the head of the voidmind creature and can attack with a reach 5 feet longer than the base creature's normal reach.

If the base creature can use weapons, the voidmind creature retains this ability. A creature with natural weapons retains those natural weapons. A voidmind creature fighting without weapons uses the primary natural attacks of the base creature, or the tentacle attack if the base creature doesn't have natural weapons. When it has a weapon, it usually uses the weapon instead.
Nowhere is the possibility to retract the tentacle mentioned, which is rather weird for a creature that's supposed to be a perfect illithid spy.