Just do this and you have no problem whatsoever.
@echo off
for /f %%s in (version.txt) do set VERSION=%%s
echo %VERSION%
Or this:
for /f "usebackq" %%s in (`type version.txt`) do set VERSION=%%s