Context. The quasar OJ287 has been under observation for over 120 years. The quasi-periodic nature of its optical light curve has led to a binary black hole model as a common explanation of the quasar. The radio jet of OJ287 has been under investigation for a shorter time, about 30 years. It has a complicated structure that varies dramatically over a time scale of a few years. Aims. Here we propose that this structure arises from a helical jet being observed from a small and varying viewing angle. The viewing angle variation is taken to be in tune with the binary orbital motion. Methods. We calculated the effect of the secondary black hole on the inner edge of the accretion disk of the primary using particle simulations. We presumed that the axis of the helix is perpendicular to the disk. We then followed the jet motion on its helical path and projected the jet to the sky plane. This projection was compared with observations both at mm waves and cm waves. Results. We find that this model reproduces the observations well if the changes in the axis of the conical helix propagate outwards with a relativistic speed of about 0.85c. In particular, this model explains at the same time the long-term optical brightness variations as varying Doppler beaming in a component close to the core, i.e., at parsec scale in real linear distance, while the mm and cm radio jet observations are explained as being due to jet wobble at much larger (100 parsec scale) distances from the core.