Stonehenge was built as part of a fertility cult with the stones positioned to cast phallic shadows inside the monument during Midsummer, a new study suggests.