A liquid crystal on silicon spatial light modulator (LCoS-SLM), operating in phase only modulation mode, was used to dynamically control the aperture diameter in an adaptive optics system. The LCoS-SLM was optically conjugated to the Fourier plane of the collimator lens focused on the stimulus. A projector was used to produce stimulus in white light. A dedicated phase profile, resembling an axicon lens, but with a constant phase within the diameter of the intended aperture, was programmed on the LCoS-SLM. The portion of the wavefront passing through the central zone with constant phase remained non-modulated, while the wavefront passing through the axicon lens was propagated away from the optical axis. A field-stop was included in an additional plane to further filter the diverging light. The phase mask acted as a low-pass spatial filter, simulating the virtual effect of a physical aperture. To evaluate the performance of the method, a motorized iris was placed into a plane optically conjugated to the LCoS-SLM. The experimental modulation transfer functions of the system were compared when obtained through the physical aperture and with the phase mask production the virtual pupil. It was found that the phase mask generated by the LCoS-SLM performs similarly to the real aperture, although the field of view had to be limited to filter out the wavefront coming from the axicon lens. This method allows, under certain conditions, to use a single LCoS-SLM to control both intensity and phase simultaneously in a system.