We analyze dispersion properties of layered metal-dielectric structures, which can be considered as a simple example of nanostructured metamaterials. We demonstrate that, in sharp contrast to the results of the theory of effective media, the layered structure demonstrates strong optical nonlocality due to excitation of surface plasmon polaritons. Such nonlocality can be engineered by changing a ratio between the thicknesses of metal and dielectric layers. Importantly, the nonlocality leads to the existence of an additional extraordinary wave that manifests itself in the splitting of the transverse-magnetic polarized beam refracted at an air-metamaterial interface.