We investigate the interaction of two two-level qubits with a single mode quantum field in a cavity without rotating wave approximation and considering that qubits can be located at an arbitrary distance from each other. We demonstrate that there exists a radiation induced interaction potential between atoms. We studied the properties of the system numerically and in addition constructed a simple analytical approximation. It is shown that the observable characteristics are substantially dependent on the distance between the qubits in the strong coupling regime. This allows one to perform the quantum control of the qubits, which can be exploited for the recording and transmission of quantum information.