We present a novel scenario for globular cluster (GC) formation, where the ultraviolet (UV) background radiation effectively works so as to produce compact star clusters. Recent observations on the age distributions of GCs indicate that many GCs formed even after the cosmic reionization epoch. This implies that a significant fraction of GCs formed in UV background radiation fields. Also, the star formation in an early-generation of subgalactic objects may be affected by strong UV radiation from pre-formed massive stars, e.g. Population III stars. Here, we explore the formation of GCs in UV radiation fields. For this purpose, we calculate baryon and dark matter (DM) dynamics in spherical symmetry, incorporating the self-shielding effects by solving the radiative transfer of UV radiation. In addition, we prescribe the star formation in cooled gas components and pursue the dynamics of formed stars. As a result, we find that the evolution of subgalactic objects in UV background radiation is separated into three types: (i) prompt star formation, where less massive clouds (åisebox-0.5ex~10$^5-8$M$_solar$) are promptly self-shielded and undergo star formation, (ii) delayed star formation, where photoionized massive clouds (>\i̊sebox-0.5ex~10$^8$M$_solar$) collapse despite high thermal pressure and are eventually self- shielded to form stars in a delayed fashion, and (iii) supersonic infall, where photoionized less massive clouds (\rs̊ebox-0.5ex~10$^5-8$M$_solar$) contract with supersonic infall velocity and are self-shielded when a compact core forms. In particular, the type (iii) is a novel type found in the present simulations, and eventually produces a very compact star cluster. The resultant mass-to-light ratios, half-mass radii and velocity dispersions for the three types are compared to the observations of GCs, dwarf spheroidals (dSphs) and ultracompact dwarfs (UCDs). It turns out that the properties of star clusters resulting from supersonic infall match well with those of observed GCs, whereas the other two types are distinct from GCs. Hence, we conclude that supersonic infall in a UV background is a promising mechanism to form GCs.