Similar to ESXi, vSAN licenses are required on a per-CPU basis so this will apply regardless of whether the hosts are contributing storage capacity to the vsandatastore or not.
"Virtual SAN Standard, Advanced, and Enterprise editions are licensed per-CPU (socket). These
are standalone licenses (i.e. not included with any other VMware license such as VMware
vSphere®, vSphere with Operations Management™, VMware vCloud Suite®, and so on)."
https://www.vmware.com/files/pdf/products/vsan/vmware-vsan-62-licensing-guide.pdf
As an aside, there is no way to configure vSAN nodes as "storage-only" (can be "compute-only" though of course).