Nonclassical problem for ultraparabolic equation with nonlocal initial condition with respect to one time variable is studied in abstract Hilbert spaces. We define the space of square integrable vector-functions with values in Hilbert spaces corresponding to the variational formulation of the nonlocal problem for ultraparabolic equation and prove trace theorem, which allows one to interpret initial conditions of the nonlocal problem. We obtain suitable a priori estimates and prove the existence and uniqueness of solution of the nonclassical problem and continuous dependence upon the data of the solution to the nonlocal problem. We consider an application of the obtained abstract results to nonlocal problem for ultraparabolic partial differential equation with second-order elliptic operator and obtain well-posedness result in Sobolev spaces.