The first measurement of jet shapes, defined as the fractional transverse momentum radial distribution, for inclusive jets produced in heavy-ion collisions is presented. Data samples of PbPb and pp collisions, corresponding to integrated luminosities of 150 inverse microbarns and 5.3 inverse picobarns respectively, were collected at a nucleon-nucleon centre-of-mass energy of sqrt(s[NN]) = 2.76 TeV with the CMS detector at the LHC. The jets are reconstructed with the anti-kt algorithm with a distance parameter R = 0.3, and the jet shapes are measured for charged particles with transverse momentum pt > 1 GeV. The jet shapes measured in PbPb collisions in different collision centralities are compared to reference distributions based on the pp data. A centrality-dependent modification of the jet shapes is observed in the more central PbPb collisions, indicating a redistribution of the energy inside the jet cone. This measurement provides information about the parton shower mechanism in the hot and dense medium produced in heavy-ion collisions.