The UK's public finances are in a "relatively vulnerable position", the government's official forecaster has warned.