Aims We use magnetic and non-magnetic 3D numerical simulations of solar granulation and G-band radiative diagnostics from the resulting models to analyse the generation of small-scale vortex motions in the solar photosphere. Methods Radiative MHD simulations of magnetoconvection are used to produce photospheric models. Our starting point is a non-magnetic model of solar convection, where we introduce a uniform magnetic field and follow the evolution of the field in the simulated photosphere. We find two different types of photospheric vortices, and provide a link between the vorticity generation and the presence of the intergranular magnetic field. A detailed analysis of the vorticity equation, combined with the G-band radiative diagnostics, allows us to identify the sources and observational signatures of photospheric vorticity in the simulated photosphere. Results Two different types of photospheric vorticity, magnetic and non-magnetic, are generated in the domain. Non-magnetic vortices are generated by the baroclinic motions of the plasma in the photosphere, while magnetic vortices are produced by the magnetic tension in the intergranular magnetic flux concentrations. The two types of vortices have different shapes. We find that the vorticity is generated more efficiently in the magnetised model. Simulated G-band images show a direct connection between magnetic vortices and rotary motions of photospheric bright points, and suggest that there may be a connection between the magnetic bright point rotation and small-scale swirl motions observed higher in the atmosphere.