The interaction of relativistic jets in AGNs with the ambient radiation field