Enhancement of fast electron energy deposition by external magnetic fields