Control of spin-charge conversion in van der Waals heterostructures