Control over physical systems at the quantum level is important in fields as diverse as metrology, information processing, simulation and chemistry. For trapped atomic ions, the quantized motional and internal degrees of freedom can be coherently manipulated with laser light. Similar control is difficult to achieve with radio-frequency or microwave radiation: the essential coupling between internal degrees of freedom and motion requires significant field changes over the extent of the atoms' motion, but such changes are negligible at these frequencies for freely propagating fields. An exception is in the near field of microwave currents in structures smaller than the free-space wavelength, where stronger gradients can be generated. Here we first manipulate coherently (on timescales of 20 nanoseconds) the internal quantum states of ions held in a microfabricated trap. The controlling magnetic fields are generated by microwave currents in electrodes that are integrated into the trap structure. We also generate entanglement between the internal degrees of freedom of two atoms with a gate operation suitable for general quantum computation; the entangled state has a fidelity of 0.76(3), where the uncertainty denotes standard error of the mean. Our approach, which involves integrating the quantum control mechanism into the trapping device in a scalable manner, could be applied to quantum information processing, simulation and spectroscopy.